package com.hqshuke.exchange.instrument.service.impl;


import com.hqshuke.exchange.instrument.service.MainService;
import com.hqshuke.exchange.instrument.vo.TestVo;
import com.hqshuke.exchange.system.dto.DemoDto;
import com.hqshuke.exchange.system.feignClient.SystemClient;
import com.hqshuke.exchange.system.vo.DemoVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class MainServiceImpl implements MainService {


    @Autowired
    private SystemClient systemClient;


    @Override
    public TestVo testService(String params) {
        //调用其他service

        //调用mapper

        //调用其他服务:get请求测试
        DemoDto demoDto = new DemoDto();
        demoDto.setRequestMsg("instrument call system");
        DemoVo test = systemClient.test(demoDto);
        log.info("receive system response : {}",test);

        //调用其他服务：post请求测试
//        DemoDto demoDto = new DemoDto();
//        demoDto.setRequestMsg("instrument call system");
//        DemoVo test = systemClient.postTest(demoDto);
//        log.info("receive system response : {}",test);

        TestVo testVo = new TestVo();
        testVo.setResponseMsg("instrument test "+params);
        return testVo;
    }
}
